using System;
using System.Collections.Generic;
using System.Text;
using ERP.BusinessEntities.Base;
using ERP.DAL.Factory;
using System.Data;
namespace ERP.BusinessEntities
{

	public class BSUsersController:BaseBusinessController
	{
		public BSUsersController()
		{
			dal = FactoryDal.CreateEndDal("BSUsers");
		}

        public BSUsersInfo GetUser(String strUserName, String strPassword)
        {
            try
            {
                String strQuery = String.Format(@"SELECT * FROM BSUsers WHERE AAStatus = 'Alive'
                                                AND No = '{0}'
                                                AND Pwd = '{1}'", strUserName, strPassword);

                DataSet ds = GetDataset(strQuery);

                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    return (BSUsersInfo)GetObjectFromDataRow(ds.Tables[0].Rows[0]);
            }
            catch (Exception ex)
            {
            }

            return null;
        }
	}
}
